package ch1;

import java.util.Scanner;

public class Zuoye03105 {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        System.out.println("请输入等腰空心三角形高度：");
        int a=0;
        while (true) {
            a=scan.nextInt();
            if (a>0){
                break;
            }
            System.out.println("重来");
        }
        for (int i=1;i<=a;i++){
            for (int b=a;b>i;b--){
                System.out.print(" ");
            }
            for (int c=1;c<=2*i-1;c++){
                if (c==1||c==2*i-1){
                    System.out.print("*");
                }
                else if (i==a){
                    System.out.print("*");
                }else if (i!=a){
                System.out.print(" ");
                }
            }
            System.out.println();
        }
    }

}
